import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL || '/'),
  
  routes: [
    {
      path: '/',
      redirect: { name: 'home' },
    },
    {
      path: '/huan-hai/',
      redirect: { name: 'home' },
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/HomePage.vue'),
      meta: {
        title: '首页',
      },
    },
    {
      path: '/SecurityTechnicalService',
      children: [
        {
          path: '/PenetrationTesting',
          name: 'test',
          component: () => import('@/views/SecurityTechnicalService/PenetrationTesting.vue'),
          meta: {
            title: '渗透测试',
          },
        },
        {
          path: '/VulnerabilityScanning',
          name: 'scanning',
          component: () => import('@/views/SecurityTechnicalService/VulnerabilityScanning.vue'),
          meta: {
            title: '漏洞扫描',
          },
        },
        {
          path: '/VulnerabilityScanning',
          name: 'response',
          component: () => import('@/views/SecurityTechnicalService/EmergencyResponse.vue'),
          meta: {
            title: '应急响应',
          },
        },
        {
          path: '/VulnerabilityScanning',
          name: 'exercise',
          component: () => import('@/views/SecurityTechnicalService/Red-BlueExercise.vue'),
          meta: {
            title: '红蓝对抗',
          },
        },
      ],
    },
    {
      path: '/DevelopmentAndEducational',
      children: [
        {
          path: '/SafetyTraining',
          name: 'training',
          component: () => import('@/views/DevelopmentAndEducational/SafetyTraining.vue'),
          meta: {
            title: '安全服务就业培训',
          },
        },
        {
          path: '/HWCamp',
          name: 'HWCamp',
          component: () => import('@/views/DevelopmentAndEducational/HWCamp.vue'),
          meta: {
            title: 'HW集训营',
          },
        },
        {
          path: '/RedTeamClass',
          name: 'redTeam',
          component: () => import('@/views/DevelopmentAndEducational/RedTeamClass.vue'),
          meta: {
            title: '红队班',
          },
        },
      ],
    },
    {
      path: '/SecurityCertification',
      children: [
        {
          path: '/cisp',
          name: 'cisp',
          component: () => import('@/views/SecurityCertification/cisp.vue'),
          meta: {
            title: 'cisp',
          },
        },
        {
          path: '/nisp',
          name: 'nisp',
          component: () => import('@/views/SecurityCertification/nisp.vue'),
          meta: {
            title: 'nisp',
          },
        },
        {
          path: '/cisp-pte',
          name: 'cisp-pte',
          component: () => import('@/views/SecurityCertification/cisp-pte.vue'),
          meta: {
            title: 'cisp-pte',
          },
        },
        {
          path: '/SCSA-S',
          name: 'SCSA-S',
          component: () => import('@/views/SecurityCertification/SCSA-S.vue'),
          meta: {
            title: '深信服SCSA-S系列认证',
          },
        },
      ],
    },
    {
      path: '/ProductService',
      name: 'productService',
      component: () => import('@/views/ProductService.vue'),
      meta: {
        title: '产品服务',
      },
    },
    {
      path: '/AboutUS',
      name: 'aboutUS',
      component: () => import('@/views/AboutUS.vue'),
      meta: {
        title: '关于我们',
      },
    },
  ],
})

export default router
